g
<template>
	<GLayout>
		首页
		<!-- <GUploader ref="GUploaderRef" /> -->

		<!-- <t-button @click="handleAbortDownload">停止下载</t-button> -->
	</GLayout>
</template>

<script setup lang="ts">
import { GLayout, GUploader, useSettingStore, MessageManager } from "@gonsin/gview";
import { computed, ref } from "vue";

const settingStore = useSettingStore();
const userLang = computed(() => settingStore.userLang);
function toggleUserLang() {
	if (userLang.value === "zh-CN") {
		settingStore.setUserLang("en");
	} else if (userLang.value === "en") {
		settingStore.setUserLang("zh-CN");
	}
}

function testMessage1() {
	MessageManager.success("成功");
}
function testMessage2() {
	MessageManager.error("登录超时，请重新登录");
}
function testMessage3() {
	MessageManager.loading("加载中");
}
function testMessage4() {
	MessageManager.question("??");
}

const GUploaderRef = ref<any>(null);
function handleAbortDownload() {
	if (GUploaderRef.value) {
		GUploaderRef.value?.abortAllDownload();
		GUploaderRef.value?.clearAllFile();
	}
}
</script>

<style scoped>
.container {
	display: flex;
	align-items: center;
	justify-content: center;
}
</style>
